package com.ityuxin.service.impl;

import com.ityuxin.dao.UserMapper;
import com.ityuxin.domain.ServiceItemlist;
import com.ityuxin.domain.User;
import com.ityuxin.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @Author: yyh
 * @Description:
 * @Date:Create：in 2021/4/3 16:04
 * @Modified By：
 */
@Service
public class UserServiceImpl implements UserService {

    @Autowired
    private UserMapper userMapper;

    @Override
    public List<User> findAll() {
      List<User>  user =  userMapper.findAll();
      return user;
    }

    @Override
    public void deleteById(Integer id) {
        userMapper.deleteById(id);
    }

    @Override
    public void addserviceitem(User user) {
        userMapper.addserviceitem(user);
    }

    @Override
    public void updateserviceitem(User user) {
        userMapper.updateserviceitem(user);
    }

    @Override
    public User findById(Integer id) {
        User user = userMapper.findById(id);
        return  user;

    }

    @Override
    public String login(User user) {
        String username = user.getUsername();
        String password =  userMapper.findPassword(username);
       return password;
    }
}
